home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 9
/
The PC-SIG Library on CD ROM - Ninth Edition.iso
/
101_200
/
DISK0112
/
DISK0112.ZIP
/
PC-TAMP2.153
< prev
next >
Wrap
Text File
|
1984-06-14
|
2KB
|
53 lines
REM --- T A M P E R P R O O F I N G ------
REM
REM Compile with BASCOM/O/T/N options
REM
FL$="PC-TAMP1.EXE"
PRINT " Tamper Proof check of Anti-tamper system PC-TAMP2 V1.53"
PRINT " ": PRINT " "
PRINT " (5) Verify 'PC-TAMP1.EXE'"
PRINT " ": PRINT " "
SUM1# = 152966668# : SUM3# = 137638331#
SUM2# = 0# : SUM4# = 0
OPEN "I",1,FL$
CLOSE 1
OPEN "R",1,FL$,128
SZ! = LOF(1)
SIZE% = SZ! / 128!
IF SZ! <> (SIZE% * 128!) THEN SIZE% = SIZE% + 1
FIELD #1, 128 AS SECTOR$
PRINT " "
COLOR 7+16,0
PRINT " * * * R U N N I N G * * *"
COLOR 7,0
FOR J%=1 TO SIZE%
GET 1, J%
FOR K%=1 TO 128
C%=ASC(MID$(SECTOR$,K%,1))
SUM2# = SUM2# + (C% * J%)
SUM4# = SUM4# + (C% * K%)
NEXT K%
NEXT J%
PRINT " ": PRINT " ": PRINT " "
CLOSE 1
PRINT " Checked ";(SIZE% * 128!);" bytes of file: "; FL$
PRINT " File ";FL$;" Security Check Sum1 Calculated ="; SUM2#
PRINT " File ";FL$;" Security Check Sum1 should be ="; SUM1#
PRINT " File ";FL$;" Security Check Sum2 Calculated ="; SUM4#
PRINT " File ";FL$;" Security Check Sum2 should be ="; SUM3#
PRINT " "
IF SUM4# <> SUM3# THEN 1370
IF SUM2# = SUM1# THEN 1500
1370 PRINT " "
PRINT "======================================================="
PRINT "S E C U R I T Y A L E R T / V I O L A T I O N"
PRINT "======================================================="
PRINT " "
PRINT FL$; " HAS BEEN ALTERED OR MODIFIED AND PROGRAM MAY BE INSECURE"
END
1500 PRINT " File "; FL$;" <<< Appears A-OK >>>"
PRINT " ": PRINT " ": PRINT " "
INPUT " <PAUSE> Press ENTER to Continue "; FL$
CHAIN "PC-MENU.EXE"
END